#include<bits/stdc++.h>
using namespace std;
#define int long long

int fun(int r, int c, int n, vector<int> x, vector<int> y) {
	sort(x.begin(), x.end());
	sort(y.begin(), y.end());

	int cnt1 = 1, cnt2 = 1;
	for (int i = 1; i < n; i++) {
		if (x[i] != x[i - 1])	cnt1++;
		if (y[i] != y[i - 1])	cnt2++;
	}
	return r * c - (r - cnt1) * (c - cnt2);
}

signed main() {
	int r, c, n, a, b;
	cin >> r >> c >> n;
	vector<int> x, y;
	for (int i = 1; i <= n; i++) {
		cin >> a >> b;
		x.push_back(a);
		y.push_back(b);
	}
	cout << fun(r, c, n, x, y);
	return 0;
}
